package org.iabako.shared.querydefinition.columndefinition;

import org.iabako.client.tools.Messages;
import org.iabako.shared.querydefinition.dto.QueryResultValueType;

import java.io.Serializable;

/**
 * Created by jose on 02/09/14.
 */
public enum InstallmentColumnEnum implements ColumnDefinition, Serializable {
    date("installment.date", "result_table_installment_date", "columnMplus smalltable", QueryResultValueType.DATE, null, null, null),
    comment("installment.comment", "result_table_installment_comment", "columnS", QueryResultValueType.ICON, "commenticon", "commenticonempty", "installment_no_comment"),
    amount("installment.amount", "result_table_installment_amount", "columnL columnrigthalign smalltable", QueryResultValueType.DOUBLE, null, null, null),

    paymentRequestBefore("installment.requestBeforeDateSent", null, null, null, null, null, null),
    paymentRequestAfter("installment.requestAfterDateSent", "result_table_installment_payment_request", "columnSplus", QueryResultValueType.ICON, "paymentrequeston", "paymentrequestoff", "installment_no_payment_request"),

    //To filter
    sale("installment.sale", null, null, null, null, null, null),
    saleClient("sale.client", null, null, null, null, null, null),

    //To sale search table
    numberOfPastInstallment("count(installment)", null, null, null, null, null, null),

    //To show
    status(null, null, "columnS columncenteralign", QueryResultValueType.ENUM, null, null, null);


    private String hqlDefinition;
    private String labelKey;
    private String className;
    private String iconClassName;
    private String iconClassNameEmpty;
    private String textEmpty;
    private QueryResultValueType queryResultValueType;

    InstallmentColumnEnum(String hqlDefinition, String labelKey, String className,
                          QueryResultValueType queryResultValueType, String iconClassName, String iconClassNameEmpty, String textEmpty) {
        this.hqlDefinition = hqlDefinition;
        this.labelKey = labelKey;
        this.className = className;
        this.iconClassName = iconClassName;
        this.queryResultValueType = queryResultValueType;
        this.iconClassNameEmpty = iconClassNameEmpty;
        this.textEmpty = textEmpty;
    }

    public String getHqlDefinition() {
        return hqlDefinition;
    }

    public String getHqlJoin() {
        return null;
    }

    public String getLabel() {
        return Messages.getLabel(labelKey);
    }

    public String getLabelKey() {
        return labelKey;
    }

    public QueryResultValueType getQueryResultValueType() {
        return queryResultValueType;
    }

    public int getExcelColumnWidth() {
        return 0;
    }

    public String getClassName() {
        return className;
    }

    public String getIconClassName() {
        return iconClassName;
    }

    public boolean isOnlyInExcelExport() {
        return false;
    }

    public String getIconClassNameEmpty() {
        return iconClassNameEmpty;
    }

    public String getTextEmpty() {
        return textEmpty;
    }

}
